<template>
    <div class="template">
        <h3>示例</h3>
        <div class="elWrapper">
            <!-- 上传 -->
            <ele-upload :uploadData="uploadData" @beforeUploadHandle='beforeUploadHandle' @uploadSuccessCallback='uploadSuccessCallback'></ele-upload>
        </div> 
        <div class="markdown-body">
            <eleUploadMD></eleUploadMD>
        </div> 
    </div> 
</template>
<script>
import {fileUpload, fileUploadvideo} from '@/api/api'
import EleUpload from '@/components/baseComponents/Upload'
import eleUploadMD from "../md/eleUploadMD.md"
export default {
    name: "Home",
    components: {
        EleUpload,
        eleUploadMD
    },
    data() {
      return {
            picture:"png",
            //上传
            uploadData: {
                // action:'',
                // action:'http://192.168.147.18/api/exam/gm-dan-grading/uploadDanGradingImage',
                apiName: fileUploadvideo, //自定义形式 --- 不需要配置action
                uploadImgLimit:2,
                hideUpload:false,
                dialogdanGradingImage:"",
                fileList:[],
                dialogImageUrl: '',
                dialogVisible: false, //上传图片放大图
                size:50, //图片大小 MB
                type:"file", //type:png | jpeg |jpg|video|audio         audio---npm install vue-mobile-audio
                videoUrl:'http://192.168.147.18/group1/M00/00/01/CgP3-l-rnUeAOBGXAElmXgE9XVA159.mp4'
            }
        }
    },
    methods: {
        //上传参数
        beforeUploadHandle(params) {
            params.append('storeMode', 2)
            params.append('fastDfsGroup', 'group1')
            return params
        },
        //上传成功回调
        uploadSuccessCallback(data) {
            // this.files = response.rspBody
            // this.videoUrl = response.rspBody.fileRelativePath
            // this.videoSid = response.rspBody.fileSid
            // this.videoName =  response.rspBody.originalFileName
            console.log(data)
        }
    },
    mounted(){
        console.log(this.$route.params.type)
        // console.log(urlCommon.queryApi.url)
    }
}
</script>
<style scoped lang>
    .elWrapper{
        width:100%;
        padding:10px 20px;
        height: 200px;
        box-sizing:border-box;
    }
</style>


